home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 126-150 / scopedisk131 / serserial / serserver.doc < prev    next >
Text File  |  1995-03-19  |  16KB  |  374 lines

  1. ***************************************************************************
  2. *                                                                         *
  3. *                          SerServer & Con1-Handler                       *
  4. *                                                                         *
  5. *             All parts (c) Copyright 1990 by Michael R. Mossman.         *
  6. *                                                                         *
  7. *                Released for private, non-commercial use.                *
  8. *                                                                         *
  9. *                     Compiled with Lattice 5.04.                         *
  10. *                                                                         *
  11. ***************************************************************************
  12.  
  13.                    SerServer - Version 1.03
  14.  
  15. What is it?
  16.  
  17.        Maybe a better name would have been CliBBS, but I started
  18.  with SerServer and so it will stay. It is a personal (with the
  19.  lack of a better word) BBS program. It gives the user a full
  20.  CLI with restrictions setup by the sysop. I don't like the word
  21.  BBS in this case, because, any program that offers a CLI to
  22.  strangers, can be a lot of trouble. I wrote the program so that
  23.  I can log on to my computer from work and do all of the things
  24.  that I do from home in a CLI. I do not recommend that you let
  25.  any Tom, Dick or Harry in to use this program. You will end up
  26.  with formatted hard drives and sleepless nights. It has three
  27.  user levels, and full Zmodem UP/DOWNLOAD. It could be a very
  28.  useful program for a few friends and your self to use, when
  29.  working on a common project. A place to share files. It
  30.  offers limited message sending and receiving.
  31.  
  32. What files are in the zoo?
  33.  
  34.        Con1-Handler   - this is the DOS handler for the CLI.
  35.        
  36.        SerServer      - this is the serial device interface and 
  37.                         it talks to Con1-Handler.
  38.             
  39.        SySop          - This program configures the "BBS" and 
  40.                         maintains the user/password list.
  41.             
  42.        help           - This is just a text file that you edit,
  43.                         to tell users what commands and devices,
  44.                         are available to them.
  45.             
  46.        logon          - Another text file that the user gets 
  47.                         before they enter their name and 
  48.                         password.
  49.             
  50.        greeting       - Another text file that the user gets 
  51.                         after login.
  52.             
  53.        mountlist      - This shows how to enter the Con1-Handler
  54.                         in your mountlist.
  55.             
  56.        Zmodem.zoo     - This zoo contains sz and rz. The two 
  57.                         public domain external protocols Zmodem
  58.                         handlers. Sz is the upload handler and
  59.                         rz receives the files.
  60.             
  61.        NoRequests.zoo - This public domain program prevents 
  62.                         requesters from coming up when the user
  63.                         asks for a disk or a drive that is not
  64.                         present in the system. You can't click 
  65.                         off a requester when your sitting at a 
  66.                         remote terminal! SerServer calls this
  67.                         program when it firsts starts up.
  68.             
  69.  
  70. Setting it up!
  71.  
  72.        First off make a mountlist entry for the Con1-Handler.
  73.  Make a directory somewhere called "bbs". Then assign it, eg -
  74.  "assign bbs: device:subdirectory/bbs". Create a subdirectory
  75.  off of bbs: and call it "mail". Next sit down with a pen
  76.  and paper and think. Write down all the devices that are
  77.  available to level 1 users (the lowest level). Think very
  78.  carefully about what devices you select. (I try to keep people
  79.  off my hard drive.) Then select the commands that level 1 users
  80.  can execute. (Format seems to be a bad choice.) Commands that
  81.  open their own window, should not be used because most of them 
  82.  will not return control to the CLI and the remote user can
  83.  not close the window. Do the same thing for level 2 users. You
  84.  might ask, why two levels? I find that I can trust some people
  85.  more then others. You might loan your Corvette to some friends
  86.  and the Volkeswagon to others. There must be one device
  87.  that is common to all level users. This is called the "HOME
  88.  DIRECTORY DEVICE". The root of this device is where all level
  89.  of users will start from when they log on. It is also the area
  90.  that all uploads and downloads take place. A file must be moved
  91.  here, before it can be sent. Received files will arrive here.
  92.  Do not use Ram: as your "HOME DIRECTORY DEVICE". Rz checks how
  93.  much space is left on Ram: before it receives a download file.
  94.  Ram: then says that it has 0 blocks free and rz aborts the transfer.
  95.  Decide what level can download from your system. Decide what
  96.  level can upload to your computer (this is much more dangerous
  97.  then downloading and should require a higher level). If you
  98.  select a level of 4 for up/downloading then no level user will be able
  99.  to send or receive files. The modem string has to be just right for
  100.  this program to work. I use ATE0 L0 M1 Q0 V1 &D2 on a Supra 2400.
  101.  I will explain each entry in case your modem is not a Supra.
  102.  
  103.           E0 - Modem does not echo back commands (this is 
  104.                important.
  105.            
  106.           L0 - Low speaker volume (does not matter).
  107.       
  108.           M1 - Speaker on until carrier received (does not 
  109.                matter).
  110.            
  111.           Q0 - Modem returns result codes after commands (this 
  112.                is important).
  113.            
  114.           V1 - Selects Verbal result codes (this is important).
  115.       
  116.          &D2 - Modem hangs up, disables autoanswer, and goes to
  117.                command state upon ON-to-OFF transition of DTR 
  118.                line (this is important).
  119.  
  120.  DO NOT PUT THE MODEM IN THE AUTOANSWER MODE eg. ATS0=1.
  121.  
  122.  Now execute Sysop and select "Configure". It will
  123.  put a file in the assigned BBS: subdirectory called config.
  124.  Enter the previous well thought out data.
  125.  Now move SerServer, Sysop, NoRequest, logon,
  126.  help and greeting into the assigned BBS: subdirectory (the text files
  127.  help, greeting and logon, do not have to be present for SerServer to
  128.  work). Copy sz and rz into the C: subdirectory. Copy Con1-Handler into
  129.  the L: subdirectory. The DOS commands copy, cd and endcli,
  130.  must be in the C: subdirectory. Use Sysop
  131.  to enter yourself and who ever, in the userlist. This will create a
  132.  file called passwords in the assigned BBS: subdirectory.
  133.  Make sure that the sysop is the first entry in the password file and 
  134.  remember the password. You will be asked for this password every time
  135.  you run this program to make changes. The program does this to prevent
  136.  someone from uploading the file to the BBS and making changes to the
  137.  config or passwords. The program also writes to the log if you fail the
  138.  password.
  139.    
  140.  Now do the following:
  141.            
  142. mount con1:                         (done after a reboot and not yet mounted)
  143.  
  144. assign bbs: device:subdirectory/bbs (after a reboot)
  145.  
  146. newcli con1:                        (every time the program is started)
  147.  
  148. SerServer                           (every time the program is started)
  149.  
  150.  
  151.  Now the program is up and running and ready for someone to
  152.  logon. The text that is received from the Con1-Handler and the
  153.  serial device is send to the CLI window that serserver is
  154.  started up from. The program can be terminated by selecting the
  155.  CLI window and typing Control C. People logging on should set
  156.  their terminal programs for 8N1.
  157.  
  158. Commands
  159.  
  160.  SerServer will parse the command line for level 1 and 2 users. If
  161. a user types "df0:dir" then the parser will eliminate the "df0:" and
  162. only "dir" will be sent to CLI (this assumes that dir is an allowed
  163. command). This along with alias (as shown later) will prevent users
  164. from renaming files (to an allowed command name) and then uploading and
  165. executing them.
  166.  Commands that should not be allowed to level 1 and 2 users are
  167. execute, alias, assign, protect, endcli and format.
  168.  
  169.  
  170. Help
  171.  
  172.   A user can type help or "?" along the command line and get a help file
  173. if the Sysop provides a text file called "help".
  174.  
  175.  
  176. Mail
  177.  
  178.    At a CLI prompt a user can type "mail" and they can leave private
  179.  or public mail. Private mail is created in a file under the users
  180.  name (the name of the user who is to receive the mail). Private mail
  181.  will be deleated after it is read by the user. Public mail is put
  182.  in a file called "ALL". It will grow in size until the sysop either
  183.  deletes it or edits it. (Some text editors can handle this file.)
  184.  All messages are saved in "bbs:mail/". 
  185.  
  186. Things to think about!
  187.  
  188.     Level 3 is the highest level user. There is no parsing of
  189.  the command line for a level 3 user. If format is in the
  190.  command path and a level 3 user says "format drive DH0: name
  191.  NOTHING" then your brand new hard drive will erase it's brains.
  192.  The same thing can happen with any level user, if you make the
  193.  command available to them. If you make Alias available as a
  194.  command then users can do things like "alias dir format" and
  195.  type "dir drive DH0: name NOTHING" and format your hard drive
  196.  if DH0: is one of the available devices and dir is an allowed
  197.  command.
  198.   
  199.  How about if you make zoo an available command and a user puts
  200.  format renamed as dir in the zoo. They can then de-zoo the file
  201.  and format your hard drive because the CLI will find dir
  202.  command in the current path (really format) before it goes to
  203.  c:.
  204.   
  205.  Endcli will terminate SerServer from a remote. I felt that this
  206.  was handy for the sysop to drop the program from a remote
  207.  terminal but can be a problem, if it is an allowed command.
  208.  What I'm trying to say is, pick your commands and devices
  209.  carefully. And most important, know who the hell your letting
  210.  on your computer! 
  211.  
  212. Timings and Stuff
  213.  
  214.       Anyone is allowed one minute to type in their name at the
  215.  login prompt, another minute for the password. Everyone is
  216.  allowed three tries and then it hangs up. Level 1 and level 2
  217.  users are allowed two minutes of inactivity at a CLI prompt
  218.  before the program drops them. Level 3 users can be at a CLI all
  219.  day and do nothing and the program will not hang up. In the Mail
  220.  section of the program, time outs will happen to any level user.
  221.  There is no limit to the over all on time for any level user as long
  222.  as they are doing something. 
  223.  
  224. Log Keeping
  225.  
  226.     The program keeps a log in the BBS: subdirectory called "log'.
  227.     This requires that BBS disk NOT be write protected.
  228.  
  229. Zmodem Stuff
  230.  
  231.     The program uses Zmodem for up/downloads. Sending from a
  232.  remote is easy. I used Online!, Telix and JrComm for testing.
  233.  Just select 32 bit CRC (16 bit works also) and at a CLI prompt
  234.  in the BBS, select upload in Online!, JrComm, or Telix. Pick
  235.  the files and then sit back and wait (have a beer) till they
  236.  all arrive at the BBS.
  237.   
  238.     Sending files requires a little more work. First the files
  239.  have to be in the "HOME DIRECTORY DEVICE" root. Use copy to
  240.  move them there. Then along the CLI prompt line type:
  241.  
  242.      send file1 file2 file3 (etc)
  243.      
  244.  Make sure your terminal program is setup for auto downloads.
  245.  
  246. "Send" will also accept several options, like so:
  247.  
  248. send -ao file1 file2
  249.  
  250. The options are these:
  251.  
  252. + - append to existing file.
  253. a - (ascii) change NL to CR/LF in text file.
  254. b - binary file transfer.
  255. e - escape all control characters.
  256. n - send file if source is newer.
  257. N - send file if source is newer or longer.
  258. o - use 16 bit CRC checking.
  259. p - protect existing destination file.
  260. r - resume/recover interrupted file transfer.
  261. y - overwrite existing file.
  262.  
  263.  Not all of the options of sz are supported in SerServer, and it
  264.  will prevent unsupported options from being used.
  265.  
  266. Neet Things
  267.  
  268.  There are some neet things that you can do with Alias. It can provide
  269. a whole bunch of extra commands this way. Say you want users to be
  270. able to read the log file but don't want them to have access to Df0:
  271. where the bbs: files are kept. You can then set up an Alias that reads
  272. like this:
  273.  
  274.       Alias log type bbs:log
  275.  
  276. You then add log as a command to the Sysop program, and users can read
  277. the log file.
  278. Say you have a bunch of users that don't know dos commands. You can add
  279. help files for each allowed command by doing somthing like this. Create
  280. a subdirectory off bbs: called "help". Then put a text file in there called
  281. "dir". This text file will explain the "Dir" command and it's options.
  282. Then set up an Alias like this:
  283.  
  284.      Alias what type bbs:help/[] 
  285.  
  286. The user then types "what dir" and gets a help file on "Dir". What has to
  287. be added to the allowed commands. 
  288.  
  289. Scripts
  290.  
  291.  Here are a couple example scripts to show you how to set up the the
  292. BBS and use the alias command.
  293.  
  294. assign bbs: df0:bbs
  295. c:mount con1:
  296. newshell con1: from s:remote-shell <---- This starts the remote-shell script.
  297. stack 10000
  298. bbs:serserver
  299. endcli
  300.  
  301.  
  302. And here is the remote-shell script.
  303.  
  304. stack 10000
  305. cd vd0:
  306. Prompt "(%N) %S>> 
  307. alias dir c:dir                  <---- You should have an entry like these
  308. alias list c:list                      for every allowed command for
  309. alias type c:type                      Level 1 & 2 users. This helps prevent 
  310. alias echo c:echo                <---- users uploading and executing a file.
  311. alias copy copy [] NOPRO BUF=10  <---- allows copyied protected files to be deleted.
  312. alias log type bbs:log           <---- Gives the log to users.
  313. alias what type bbs:help/[]      <---- If you want help files.
  314.  
  315.  
  316.  
  317. Bugs and Other Critters of the Night
  318.  
  319.      Well this is version 1.03, so what can I say. People doing
  320.  buffer dumps and hanging up in the middle of things can always
  321.  be a problem. I have tried to catch these problems, but bugs
  322.  always seem to surface. I am releasing the executable but will
  323.  retain the source on this one. Let me know if you find any
  324.  problems. Please don't say it just locked up, try to tell me
  325.  what the program was doing, when it locked up!
  326.  
  327. Things to Do
  328.  
  329.     Programs like this always have things that can be added. I
  330.  might add a chat feature in the future. But for now, this meets my
  331.  needs. I program for me first and you last.  
  332.  
  333. CopyRight and Things
  334.  
  335.     I am retaining the copyright on Con1-Handler and SerServer Version 1.03
  336.  but will release it's use to the public for non-commercial use.
  337.    
  338.  
  339. How To Rip Me Apart
  340.  
  341.    You can contact me on CompuServe, my UI is 76515,3017. You can also
  342.  reach me on Fido Net 1:255/1 or Punter Net Node 95.
  343.  
  344. Thanks
  345.  
  346.    Many thanks to Wayne Marchand and the Mad Scientist for debugging and
  347.   helpful comments. A real big thanks goes out to Mad for pulling down
  348.   his bbs and putting up SerServer. This found bugs, that would have
  349.   taken years to find by using a term prog on my 500 and SerServer
  350.   installed on my 2500.
  351.  
  352.  
  353. History
  354.    
  355.    Version 1.00 - Orginal alpha testing version. Not released to public.
  356.    
  357.    Version 1.01 - Fixed bug in dropped carrier lockup. Program was 
  358.                   waiting on timer message that never came. Fixed 
  359.           PassWordMaker so that it did not wreck the password 
  360.           file when editing user entries. Not released to public.
  361.           
  362.    Version 1.02 - Added log keeping and moved sz & rz into the C:
  363.                   subdirectory from the "HOME DIRECTORY". Not released
  364.           to the public.
  365.           
  366.    Version 1.03 - PassWordMaker was rewritten by The Mad Scientist and
  367.                   called Sysop. Thanks a lot Doug! (call his BBS at
  368.           506-648-9196). Added the mail feature and caught a
  369.           few more bugs. Added Mail to the Sysop program so
  370.           the sysop can read his own mail (or anyone's).
  371.                   Made level 1 and 2 users command line get parsed
  372.           so a path can not be set to a command. Password 
  373.           protected the Sysop file.
  374.